<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="resources/js/jquery-1.9.1.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<%	if((String)session.getAttribute("login")!=(String)null){	
	response.sendRedirect("loging.jsp");	
}
%>
<script language="JavaScript">

	function loginsuccess(){
		alert("로그인중기다려주십시오.");
		location.href='../main/main.jsp';
// 		frm.submit();
	}

	function loginCheck(){
		var id = document.frm.id.value;
		var pw = document.frm.pw.value;
		var param = "id" + "=" + id + "&" +"pw" + "="+ pw;
		$.ajax({
			url : "./login.fo",
			type : "POST",
			data : param,
			cache : false,
			async : false,
			dataType : "text",
	
			success : function(args) {								
				if(args=='')
				{
					alert("아이디 또는 비번이 틀렸습니다. 다시 입력하세요.")
					return false;
				}
				else
				{
					loginsuccess();
				}	
				
				alert(check);
			},
			error : function(request, status, error) {
				if (request.status != '0') {
					alert("code : " + request.status + "\r\nmessage : "
							+ request.reponseText + "\r\nerror : " + error);
				}
			}
	
		});
	}
	
</script>
<!-- 탑 인클루드 -->
<jsp:include page="/main/header.jsp"></jsp:include>
<br><br><br><br><br>
<body>
	<div class="content_inner">   <div class="container">   <div class="container_inner clearfix">
	<p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p>
	<form name="frm" id = "frm" method="post" action = "./login.fo">
		<P align="center">
			<FONT size="6" align="center" ><B>로그인 페이지</B></FONT>
		</P>
				
		<table border="0" align="center">
			<tr>
				<td colspan="2" bgcolor="PeachPuff" align="center" height="30"><b>로그인 확인</b></td>
			</tr>
<p>&nbsp;</p> 
			<tr align="center">
				<td bgcolor="PeachPuff" width="100">아이디</td>
				<td><input type="text" id="id" name="id" size="12" maxlength="20"></td>
			</tr>

			<tr align="center">
				<td bgcolor="PeachPuff">비밀번호</td>
				<td><input type="password" id="pw" name="pw" size="12" maxlength="12"></td>
			</tr>

			<tr>
				<td colspan="2" bgcolor="PeachPuff" align="center" height="30">
					<input type="button" value="로그인" onclick="loginCheck();"> 
					<input type="button" value="회원 가입" onclick="javascript:location.href='../member/member.jsp';">
					<input type="button" value="비번찾기" onclick="javascript:location.href='passwordSearch.jsp';"> 
				</td>
			</tr>
		</table> 
	</form> </div> </div> </div>
</body>
</html>